<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8"/>
    <title>订单信息查询 - 客户关系管理系统</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta content="Premium Multipurpose Admin & Dashboard Template" name="description"/>
    <meta content="" name="author"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>

    <!-- App favicon -->
    <link rel="shortcut icon" href="../assets/images/logo-1.png">

    <!-- App css -->
    <link href="../assets/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
    <link href="../assets/css/jquery-ui.min.css" rel="stylesheet">
    <link href="../assets/css/icons.min.css" rel="stylesheet" type="text/css"/>
    <link href="../assets/css/metisMenu.min.css" rel="stylesheet" type="text/css"/>
    <link href="../assets/css/app.min.css" rel="stylesheet" type="text/css"/>

</head>

<body class="dark-topbar dark-sidenav">

<!-- Top Bar Start -->
<div th:replace="~{common/Top-bar::top-bar}"></div>
<!-- Top Bar End -->


<!-- Left Sidenav -->
<div th:replace="~{common/Left-side-nav::left-side-nav}"></div>
<!-- end left-sidenav-->

<div class="page-wrapper">
    <!-- Page Content-->
    <div class="page-content">

        <div class="container-fluid">
            <!-- Page-Title -->
            <div class="row">
                <div class="col-sm-12">
                    <div class="page-title-box">
                        <h4 class="page-title">历史订单查询</h4>
                    </div>
                    <!--end page-title-box-->
                </div>
                <!--end col-->
            </div>
            <!-- end page title end breadcrumb -->
            <div class="row">
                <div class="col-lg-12">
                    <div class="card">
                        <div class="card-body">
                            <form th:action="@{/basicdata/order_list}" method="get" class="form-inline mb-3">
                                <input type="hidden" name="pageSize" th:value="${page.pageSize}">
                                <div class="form-group">
                                    <label class="sr-only" for="keyword">搜索</label>
                                    <input name="keyword" th:value="${keyword}" type="text" class="form-control" id="keyword" placeholder="请输入关键字">
                                </div>

                                <button type="submit" class="btn btn-gradient-primary ml-4">搜索</button>
                                <button id="clearBtn" type="button" class="btn btn-gradient-danger ml-4">清除</button>
                            </form>
                            <div class="table-responsive">
                                <table class="table table-striped mb-0">
                                    <thead>
                                    <tr>
										<th>序号</th>
                                        <th>下单客户</th>
                                        <th>下单产品</th>
                                        <th>产品数量</th>
                                        <th>下单时间</th>
                                        <th>其他信息</th>
<!--                                        <th>操作</th>&lt;!&ndash;th:if="${session.user.level == '管理员'}"&ndash;&gt;-->
                                    </tr>
                                    </thead>
                                    <tbody th:remove="all-but-first">
                                    <tr th:each="order : ${page.list}"
									>
										<td th:text="${orderStat.count}"></td>
                                        <td th:text="${order.cId}"></td>
                                        <td th:text="${order.pId}"></td>
                                        <td th:text="${order.pNum}"></td>
                                        <td th:text="${order.orderTime}"></td>
                                        <td th:text="${order.other}"></td>
<!--                                        <td>&lt;!&ndash;th:if="${session.user.level == '管理员'}"&ndash;&gt;-->
<!--                                            <a th:href="@{/basicdata/order_modify(id=${order.id},pageSize=${page.pageSize},pageNum=${page.pageNum},keyword=${keyword})}" class="mr-2"><i-->
<!--                                                    class="fas fa-edit text-info font-16"></i></a>-->
<!--                                            <a th:href="@{/basicdata/order_remove(id=${order.id},pageSize=${page.pageSize},pageNum=${page.pageNum},keyword=${keyword})}"><i-->
<!--                                                    class="fas fa-trash-alt text-danger font-16 removeBtn"></i></a>-->
<!--                                        </td>-->
                                    </tr>

                                    <tr>
                                        <td>平原科技</td>
                                        <td>020-98786754</td>
                                        <td>北京昌平</td>
                                        <td>张兵</td>
                                        <td>公司简介</td>
                                        <td>
                                            <a href="#" class="mr-2"><i
                                                    class="fas fa-edit text-info font-16"></i></a>
                                            <a href="#"><i
                                                    class="fas fa-trash-alt text-danger font-16"></i></a>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>平原科技</td>
                                        <td>020-98786754</td>
                                        <td>北京昌平</td>
                                        <td>张兵</td>
                                        <td>公司简介</td>
                                        <td>
                                            <a href="#" class="mr-2"><i
                                                    class="fas fa-edit text-info font-16"></i></a>
                                            <a href="#"><i
                                                    class="fas fa-trash-alt text-danger font-16"></i></a>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>平原科技</td>
                                        <td>020-98786754</td>
                                        <td>北京昌平</td>
                                        <td>张兵</td>
                                        <td>公司简介</td>
                                        <td>
                                            <a href="#" class="mr-2"><i
                                                    class="fas fa-edit text-info font-16"></i></a>
                                            <a href="#"><i
                                                    class="fas fa-trash-alt text-danger font-16"></i></a>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>平原科技</td>
                                        <td>020-98786754</td>
                                        <td>北京昌平</td>
                                        <td>张兵</td>
                                        <td>公司简介</td>
                                        <td>
                                            <a href="#" class="mr-2"><i
                                                    class="fas fa-edit text-info font-16"></i></a>
                                            <a href="#"><i
                                                    class="fas fa-trash-alt text-danger font-16"></i></a>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                                <!--end /table-->

                            </div>
                            <!--end /tableresponsive-->
                            <div class="row mt-3">
                                <div class="col-sm-6">
											<span class="align-middle">共<span th:text="${page.total}"></span>条，每页显示
												<select name="pageSize" id="pageSizeSelect">
													<option th:each="pageSize : ${#numbers.sequence(5, 30, 5)}"
                                                            th:value="${pageSize}" th:text="${pageSize}"
															th:selected="${pageSize} == ${page.pageSize}"></option>
												</select>条数据
											</span>
                                </div>
                                <div class="col-sm-6">
                                    <nav aria-label="Page navigation example">
                                        <ul class="pagination justify-content-end">
                                            <li th:class="${page.isFirstPage}? 'page-item disabled':'page-item'">
                                                <a class="page-link"
                                                   th:href="@{/basicdata/order_list(pageNum=${page.prePage},pageSize=${page.pageSize},keyword=${keyword})}">上一页</a>
                                            </li>
                                            <li th:class="${pageNum} == ${page.pageNum}? 'page-item active':'page-item'"
                                                th:each="pageNum : ${#numbers.sequence(1, page.pages)}">
                                                <a class="page-link" th:text="${pageNum}"
                                                   th:href="@{/basicdata/order_list(pageNum=${pageNum},pageSize=${page.pageSize},keyword=${keyword})}">1</a>
                                            </li>
                                            <li th:class="${page.isLastPage}? 'page-item disabled':'page-item'">
                                                <a class="page-link"
                                                   th:href="@{/basicdata/order_list(pageNum=${page.nextPage},pageSize=${page.pageSize},keyword=${keyword})}">下一页</a>
                                            </li>
                                        </ul>
                                    </nav>
                                </div>

                            </div>

                        </div>
                        <!--end card-body-->
                    </div>
                    <!--end card-->
                </div> <!-- end col -->
            </div> <!-- end row -->

        </div><!-- container -->
        <!--end footer-->
    </div>
    <!-- end page content -->
</div>
<!-- end page-wrapper -->


<!-- jQuery  -->
<script src="../assets/js/jquery.min.js"></script>
<script src="../assets/js/bootstrap.bundle.min.js"></script>
<script src="../assets/js/metismenu.min.js"></script>
<script src="../assets/js/waves.js"></script>
<script src="../assets/js/feather.min.js"></script>
<script src="../assets/js/jquery.slimscroll.min.js"></script>
<script src="../assets/js/jquery-ui.min.js"></script>

<!-- App js -->
<script src="../assets/js/app.js"></script>

<script>
    // 为页面大小下拉框注册change事件响应
	$('#pageSizeSelect').change(function (event) {
		let pageSize = $('#pageSizeSelect').val();
		let keyword = $('#keyword').val();
		window.location = '/basicdata/order_list?pageNum=1&pageSize=' + pageSize + "&keyword=" + keyword;
	})

    $('#clearBtn').click(function (event) {
        let pageSize = $('#pageSizeSelect').val();
        window.location = '/basicdata/order_list?pageNum=1&pageSize=' + pageSize+"&keyword=";
    })

    // 为每一个删除按钮注册d单击事件
    // 使用类选择器选择出所有s删除按钮对象，并对每一个对象注册单击事件响应
    // 如果返回false会阻止a标签上默认ddi点击动作
    $('.removeBtn').click(function(event){
        return confirm('是否删除该信息?');
    })
</script>

</body>

</html>
